<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>特征重要性 - 糖尿病风险预测</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <div class="container">
        <header>
            <h1>特征重要性分析</h1>
            <p>了解哪些特征对糖尿病预测最重要</p>
        </header>

        <div class="importance-container">
            <div class="importance-chart">
                {% for item in importance %}
                <div class="chart-bar">
                    <div class="bar-label">{{ item.feature }}</div>
                    <div class="bar-fill" style="width: {{ item.importance * 100 }}%;"></div>
                    <div class="bar-value">{{ "%.4f"|format(item.importance) }}</div>
                </div>
                {% endfor %}
            </div>

            <div class="importance-explanation">
                <h3>特征解释</h3>
                <ul>
                    <li><strong>Glucose (血糖)</strong>: 空腹血糖水平</li>
                    <li><strong>BMI (体重指数)</strong>: 体重(kg)除以身高(m)的平方</li>
                    <li><strong>Age (年龄)</strong>: 年龄（岁）</li>
                    <li><strong>DiabetesPedigreeFunction (糖尿病家族史函数)</strong>: 基于家族史的糖尿病遗传风险</li>
                    <li><strong>Insulin (胰岛素)</strong>: 2小时血清胰岛素水平</li>
                    <li><strong>BloodPressure (血压)</strong>: 舒张压(mm Hg)</li>
                    <li><strong>Pregnancies (怀孕次数)</strong>: 怀孕次数</li>
                    <li><strong>SkinThickness (皮褶厚度)</strong>: 三头肌皮褶厚度(mm)</li>
                </ul>
            </div>
        </div>

        <div class="form-actions">
            <a href="/" class="btn-back">返回主页</a>
        </div>

        <footer>
            <p>© 2023 糖尿病风险预测系统</p>
        </footer>
    </div>
</body>
</html> 